﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="listagem.aspx.cs" Inherits="projetoFinal.pages.administracao.prestador.listagem" %>
<%@ Register src="../../includes/menuLeft.ascx" tagname="menuLeft" tagprefix="menuEsquerda" %>
<%@ Register src="../../includes/menuTop.ascx" tagname="menuTop" tagprefix="menuTopo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head id="Head1" runat="server">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>ProAdmin</title>
		<!--// FOLLOWING SCRIPT IS FOR PNG FIX IE5.5/IE6-->
		<!--[if lt IE 7]>
			<script defer type="text/javascript" src="../../js/pngfix.js"></script> 
		<![endif]--> 
		<link href="../../css/styles.css" rel="stylesheet" type="text/css" />
        <script src="../../js/valida.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript">
		    function checkTodos(valor) {
		        var form = document.getElementById("form1");
		        for (i = 0; i < form.elements.length; i++) {
		            if (form.elements[i].type == "checkbox") {
		                form.elements[i].checked = valor;
		            }
		        }
		    }

		    function apagar() {
		        var form = document.getElementById("form1");
		        var cont = 0;
		        for (i = 0; i < form.elements.length; i++) {
		            if (form.elements[i].type == "checkbox") {
		                if (form.elements[i].getAttribute("tipo") == null) {
		                    if (form.elements[i].checked) {
		                        cont++;
		                        break;
		                    }
		                }
		            }
		        }
		        if (cont > 0) {
		            if (confirm("Podem existir registros atrelados a este(s) prestador de serviço(s). Você deseja realmente apagar este(s) registro(s)?")) {
		                return true;
		            } else {
		                return false;
		            }
		        } else {
		            alert("Você deve selecionar ao menos um registro para apagar!");
		            return false;
		        }
		    }
		    function showHideCamposFiltro() {
		        var trCamposFiltro = document.getElementById("trCamposFiltro");
		        var imgOpenFiltro = document.getElementById("imgOpenFiltro");

		        if ((trCamposFiltro != null) && (imgOpenFiltro != null)) {
		            if (trCamposFiltro.style.display == "none") {
		                imgOpenFiltro.src = "../../images/icons/arrow-top-double.png";
		                trCamposFiltro.style.display = "";
		            } else {
		                imgOpenFiltro.src = "../../images/icons/arrow-down-double.png";
		                trCamposFiltro.style.display = "none";
		            }
		        }
		    }
		</script>
	</head>
	<body>
	    <form id="form1" runat="server" defaultbutton="btnFiltro">
		    <!--// Horisontal submenu edit starts -->
		    <div class="bodytext" id="submenu"></div>
		    <!--// Horizontal submenu edit ends -->
            <menuTopo:menuTop ID="menuTopo" runat="server" />
		    <!--// leftcolumn edit starts -->
		    <!--// Mainnavigation edit starts -->
		    <div id="leftcolumn">
		        <menuEsquerda:menuLeft ID="menuEsquerda" runat="server" />
		    </div>
		    <!--// leftcolumn edit ends -->
		    <!--// Copyright ends -->
		    <!--// leftcolumn ends -->
		    <!--// Content starts -->
		    <div id="content">
			    <table width="772" border="0" cellpadding="0" cellspacing="0">
				    <tr>
					    <th valign="middle" bgcolor="#E5E5E5" width="700" scope="col"><h1 align="left">Prestador de Serviço</h1></th>
					    <th valign="middle" bgcolor="#E5E5E5" width="72" scope="col"><h3 align="right"><a href="dados.aspx">Incluir</a></h3></th> <!--// H1 Title -->
				    </tr>
                    <tr id="trFiltro">
                        <td colspan="2" valign="top" align="left" width="772">
                            <table border="0" width="772" style="border: 1px solid #000;">
                                <tr>
                                    <td style="padding-left:20px;"><h4>Filtro</h4></td>
                                    <td align="right" style="padding-right:22px; padding-bottom:3px;"><a href="javascript:void(0);" onclick="javascript:showHideCamposFiltro();"><img src="../../images/icons/arrow-down-double.png" id="imgOpenFiltro" border="0" alt="Filtro" width="20" /></a></td>
                                </tr>
                                <tr id="trCamposFiltro" style="display:none;">
                                    <td valign="top" align="left" colspan="2">
                                        <table border="0" style="padding-left:25px;">
                                            <tr>
                                                <td><div class="bodytext_fieldstitle_filtro">Código</div></td>
                                            </tr>
                                            <tr>
                                                <td><input name="txtCodigo" type="text" class="fieldsFiltro" id="txtCodigo" value="" runat="server" size="40" /></td>
                                            </tr>
                                            <tr>
                                                <td height="5"></td>
                                            </tr>
                                            <tr>
                                                <td><div class="bodytext_fieldstitle_filtro">Nome</div></td>
                                            </tr>
                                            <tr>
                                                <td><input name="txtNome" type="text" class="fieldsFiltro" id="txtNome" maxlength="150" value="" runat="server" size="40" /></td>
                                            </tr>
                                            <tr>
                                                <td height="5"></td>
                                            </tr>
                                            <tr>
                                                <td><div class="bodytext_fieldstitle_filtro">CNPJ</div></td>
                                            </tr>
                                            <tr>
                                                <td><input name="txtCnpj" type="text" class="fieldsFiltro" id="txtCnpj" maxlength="18" value="" runat="server" size="40" /></td>
                                            </tr>
                                            <tr>
                                                <td height="5"></td>
                                            </tr>
                                            <tr>
                                                <td><div class="bodytext_fieldstitle_filtro">UF</div></td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <select name="selUF" id="selUF" runat="server">
						                                <option value="">Selecione...</option>
						                                <option value="AC">Acre</option> 
									                    <option value="AL">Alagoas</option>
									                    <option value="AP">Amapá</option>
									                    <option value="AM">Amazonas</option>
									                    <option value="BA">Bahia</option>
									                    <option value="CE">Ceará</option>
									                    <option value="DF">Distrito Federal</option>
									                    <option value="ES">Espírito Santo</option>
									                    <option value="GO">Goiás</option>
									                    <option value="MA">Maranhão</option>
									                    <option value="MT">Mato Grosso</option>
									                    <option value="MS">Mato Grosso do Sul</option>
									                    <option value="MG">Minas Gerais</option>
									                    <option value="PA">Pará</option>
									                    <option value="PB">Paraíba</option>
									                    <option value="PR">Paraná</option>
									                    <option value="PE">Pernambuco</option>
									                    <option value="PI">Piauí</option>
									                    <option value="RJ">Rio de Janeiro</option>
									                    <option value="RN">Rio Grande do Norte</option>
									                    <option value="RS">Rio Grande do Sul</option>
									                    <option value="RO">Rondônia</option>
									                    <option value="RR">Roraima</option>
									                    <option value="SC">Santa Catarina</option>
									                    <option value="SP">São Paulo</option>
									                    <option value="SE">Sergipe</option>
									                    <option value="TO">Tocantins</option>
								                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="5"></td>
                                            </tr>
                                            <tr>
                                                <td><div class="bodytext_fieldstitle_filtro">Situação Financeira</div></td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <select name="selSitFinanceira" id="selSitFinanceira" runat="server">
						                                <option value="">Selecione...</option>
						                                <option value="1">Em dia</option>
						                                <option value="2">Em atraso</option>
								                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="5"></td>
                                            </tr>
                                            <tr>
                                                <td><div class="bodytext_fieldstitle_filtro">Status</div></td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <label style="color: #777777;font-family: Arial, Helvetica, sans-serif; font-size: 12px;"><input type="radio" name="radStatus" id="radStatusAtivo" validate="true" mensagem="Status não escolhido" value="1" runat="server" /> Ativo</label><br />
						                            <label style="color: #777777;font-family: Arial, Helvetica, sans-serif; font-size: 12px;"><input type="radio" name="radStatus" id="radStatusInativo" value="2" runat="server" /> Inativo</label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="5"></td>
                                            </tr>
                                            <tr>
                                                <td><asp:Button ID="btnFiltro" runat="server" CssClass="button" Text="Filtrar" onclick="btnFiltro_Click" /></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
			    </table>

			    <div id="tables"> <!--// Tables starts -->
			        <table width="746" cellspacing="0">
					    <tr>
						    <td colspan="4">
                                <br /><br /><br />
							    <div id="positive" runat="server"> <!--// Positive message -->
								    <table width="450" cellpadding="0" cellspacing="12">
									    <tr>
										    <td width="52"><div align="center"><img src="../../images/icons/positive.png" alt="positive" width="22" height="16" /></div></td>
										    <td width="388" class="bodytext style3"><strong><asp:Literal ID="lblTitlePositive" runat="server" /></strong> <asp:Literal ID="lblMessagePositive" runat="server" /><br /></td>
									    </tr>
								    </table>
							    </div>
							    <div id="negative" runat="server"> <!--// error message -->
								    <table width="450" cellpadding="0" cellspacing="12">
									    <tr>
										    <td width="52"><div align="center"><img src="../../images/icons/negative.png" alt="negative" width="18" height="18" /></div></td>
										    <td width="388" class="bodytext style4"><strong><asp:Literal ID="lblTitleNegative" runat="server" /></strong> <asp:Literal ID="lblMessageNegative" runat="server" /></td>
									    </tr>
								    </table>
							    </div>
							    <div id="information" runat="server"> <!--// information message -->
								    <table width="450" cellpadding="0" cellspacing="12">
									    <tr>
										    <td width="52"><div align="center"><img src="../../images/icons/information.png" alt="information" width="18" height="18" /></div></td>
										    <td width="388" class="bodytext style4"><strong><asp:Literal ID="lblTitleInformation" runat="server" /></strong> <asp:Literal ID="lblMessageInformation" runat="server" /></td>
									    </tr>
								    </table>
							    </div>
							    <br />
						    </td>
					    </tr>
				    </table>
				    <br />

			        <asp:DataList ID="tblListagem" Width="746" CellSpacing="0" runat="server" onitemdatabound="tblListagem_ItemDataBound" onitemcommand="tblListagem_ItemCommand">
			            <HeaderTemplate>
			                <tr>
						        <th width="56" height="40" class="title_table" scope="col" align="center"><input type="checkbox" name="checkbox" id="checkbox" onclick="javascript:checkTodos(this.value);" tipo="header" /></th>
						        <th width="37" height="40" class="title_table" scope="col">
							        <div align="center" class="tabletitles">
								        <div align="left"></div>
							        </div>
						        </th>
						        <th width="147" height="40" class="title_table" scope="col">
							        <div align="center" class="tabletitles">
								        <div align="left">Código</div>
							        </div>
						        </th>
						        <th width="161" height="40" class="title_table" scope="col">
							        <div align="center" class="tabletitles">
								        <div align="left">Nome</div>
							        </div>
						        </th>
						        <th width="161" height="40" class="title_table" scope="col">
							        <div align="center" class="tabletitles">
								        <div align="left">Matrícula</div>
							        </div>
						        </th>
					        </tr>
			            </HeaderTemplate>
			            <ItemTemplate>
			                <tr>
						        <td height="40" class="bodytext">
							        <div align="center">
								        <label></label>
								        <input type="checkbox" name="chkListagem" id="chkListagem" runat="server" />
							        </div>
						        </td>
						        <td width="37" height="40" class="bodytext_table"><a href="#" id="lnkEdicao" runat="server"><img src="../../images/icons/edit.png" alt="editar" width="18" height="18" border="0" /></a></td>
						        <td height="40" class="bodytext_table">
							        <div align="left">
								        <blockquote>
									        <blockquote><asp:literal id="lblCodigo" runat="server" /></blockquote>
								        </blockquote>
							        </div>
						        </td>
						        <td height="40" class="bodytext_table"><div align="left"><a href="#"><asp:literal id="lblDescr" runat="server" /></a></div></td>
						        <td height="40" class="bodytext_table"><div align="left"><a href="#"><asp:literal id="lblMatricula" runat="server" /></a></div></td>
					        </tr>
			            </ItemTemplate>
			            <AlternatingItemTemplate>
			                <tr>
						        <td height="40" bgcolor="#E5E5E5" class="bodytext">
							        <div align="center">
								        <input type="checkbox" name="chkListagem" id="chkListagem" runat="server" />
							        </div>
						        </td>
						        <td height="40" bgcolor="#E5E5E5" class="bodytext_table"><div align="left"><a href="#" id="lnkEdicao" runat="server"><img src="../../images/icons/edit.png" alt="editar" width="18" height="18" border="0" /></a></div></td>
						        <td height="40" bgcolor="#E5E5E5" class="bodytext_table"><div align="left"><asp:literal id="lblCodigo" runat="server" /></div></td>
						        <td height="40" bgcolor="#E5E5E5" class="bodytext_table"><div align="left"><a href="#"><asp:literal id="lblDescr" runat="server" /></a></div></td>
						        <td height="40" bgcolor="#E5E5E5" class="bodytext_table"><div align="left"><a href="#"><asp:literal id="lblMatricula" runat="server" /></a></div></td>
					        </tr>
                        </AlternatingItemTemplate>
                        <FooterTemplate>
                            <tr>
						        <td colspan="2" height="30" class="title_table">
							        <div style="padding-left:20px;">
								        <input type="image" name="imgDelete" id="imgDelete" src="../../images/icons/arrow_turn_right.png" width="16" height="16" border="0" />
								        <asp:ImageButton runat="server" CommandArgument="" CommandName="deletar" ID="imgDeletar" ImageUrl="../../images/icons/trash.gif" Width="16" Height="16" BorderWidth="0" />
							        </div>
						        </td>
						        <td colspan="3" height="30" class="title_table" scope="col">
        							
						        </td>
					        </tr>
                        </FooterTemplate>
			        </asp:DataList>
			    </div>
			    <!--// Tables ends -->
			    <p class="bodytext">&nbsp;</p>
			    <h1><br /></h1>
		    </div>
		    <!--// content ends -->  
		</form>
	</body>
</html>